home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / g_man / cat3 / OpenGL-ftn / fglmap1.z / fglmap1
Text File  |  1998-10-20  |  19KB  |  277 lines

  1.  
  2.  
  3.  
  4. ffffggggllllMMMMaaaapppp1111((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp1111((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ffffggggllllMMMMaaaapppp1111dddd,,,, ffffggggllllMMMMaaaapppp1111ffff - define a one-dimensional evaluator
  10.  
  11.  
  12. FFFFOOOORRRRTTTTRRRRAAAANNNN SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      SUBROUTINE ffffggggllllMMMMaaaapppp1111dddd( INTEGER*4 _t_a_r_g_e_t,
  14.                           REAL*4 _u_1,
  15.                           REAL*4 _u_2,
  16.                           INTEGER*4 _s_t_r_i_d_e,
  17.                           INTEGER*4 _o_r_d_e_r,
  18.                           CHARACTER*8 _p_o_i_n_t_s )
  19.      SUBROUTINE ffffggggllllMMMMaaaapppp1111ffff( INTEGER*4 _t_a_r_g_e_t,
  20.                           REAL*4 _u_1,
  21.                           REAL*4 _u_2,
  22.                           INTEGER*4 _s_t_r_i_d_e,
  23.                           INTEGER*4 _o_r_d_e_r,
  24.                           CHARACTER*8 _p_o_i_n_t_s )
  25.  
  26.  
  27. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  28.      _t_a_r_g_e_t  Specifies the kind of values that are generated by the evaluator.
  29.              Symbolic constants GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333, GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444,
  30.              GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX, GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444, GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL,
  31.              GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111, GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222,
  32.              GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333, and GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444 are
  33.              accepted.
  34.  
  35.      _u_1, _u_2  Specify a linear mapping of u, as presented to ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111, to
  36.              u', the variable that is evaluated by the equations specified by
  37.              this command.
  38.  
  39.      _s_t_r_i_d_e  Specifies the number of floats or doubles between the beginning
  40.              of one control point and the beginning of the next one in the
  41.              data structure referenced in _p_o_i_n_t_s.  This allows control points
  42.              to be embedded in arbitrary data structures.  The only constraint
  43.              is that the values for a particular control point must occupy
  44.              contiguous memory locations.
  45.  
  46.      _o_r_d_e_r   Specifies the number of control points.  Must be positive.
  47.  
  48.      _p_o_i_n_t_s  Specifies a pointer to the array of control points.
  49.  
  50.  
  51. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  52.      Evaluators provide a way to use polynomial or rational polynomial mapping
  53.      to produce vertices, normals, texture coordinates, and colors.  The
  54.      values produced by an evaluator are sent to further stages of GL
  55.      processing just as if they had been presented using ffffggggllllVVVVeeeerrrrtttteeeexxxx, ffffggggllllNNNNoooorrrrmmmmaaaallll,
  56.      ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, and ffffggggllllCCCCoooolllloooorrrr commands, except that the generated values do
  57.      not update the current normal, texture coordinates, or color.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ffffggggllllMMMMaaaapppp1111((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp1111((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      All polynomial or rational polynomial splines of any degree (up to the
  75.      maximum degree supported by the GL implementation) can be described using
  76.      evaluators.  These include almost all splines used in computer graphics,
  77.      including B-splines, Bezier curves, Hermite splines, and so on.
  78.  
  79.      Evaluators define curves based on Bernstein polynomials.  Define p(u') as
  80.  
  81.                                                     n
  82.                      p(u')  =  sum from i=0 to n  B (u') * R
  83.                                                    i        i
  84.  
  85.  
  86.                                        n
  87.      where R  is a control point and B (u') is the ith Bernstein polynomial of
  88.             i                         i
  89.      degree n (_o_r_d_e_r = n+1):
  90.  
  91.  
  92.                                       (    )
  93.                              n           n     i      n-i
  94.                            B (u')  =  |    | u' (1-u')
  95.                             i
  96.                                       (i  )
  97.  
  98.  
  99.  
  100.      Recall that
  101.  
  102.                                          (    )
  103.                                0           n
  104.                               0  _= 1 and |    |   _=  1
  105.  
  106.                                          (0  )
  107.  
  108.  
  109.      ffffggggllllMMMMaaaapppp1111 is used to define the basis and to specify what kind of values
  110.      are produced.  Once defined, a map can be enabled and disabled by calling
  111.      ffffggggllllEEEEnnnnaaaabbbblllleeee and ffffggggllllDDDDiiiissssaaaabbbblllleeee with the map name, one of the nine predefined
  112.      values for _t_a_r_g_e_t described below.  ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111 evaluates the one-
  113.      dimensional maps that are enabled.  When ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111 presents a value
  114.      u, the Bernstein functions are evaluated using u', where
  115.  
  116.                             u'  =  (u - u1) / (u2 - u1)
  117.  
  118.  
  119.      _t_a_r_g_e_t is a symbolic constant that indicates what kind of control points
  120.      are provided in _p_o_i_n_t_s, and what output is generated when the map is
  121.      evaluated.  It can assume one of nine predefined values:
  122.  
  123.      GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333         Each control point is three floating-point
  124.                               values representing x, y, and z.  Internal
  125.                               ffffggggllllVVVVeeeerrrrtttteeeexxxx3333 commands are generated when the map
  126.                               is evaluated.
  127.  
  128.      GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444         Each control point is four floating-point values
  129.                               representing x, y, z, and w.  Internal
  130.                               ffffggggllllVVVVeeeerrrrtttteeeexxxx4444 commands are generated when the map
  131.                               is evaluated.
  132.  
  133.      GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX            Each control point is a single floating-point
  134.                               value representing a color index.  Internal
  135.                               ffffggggllllIIIInnnnddddeeeexxxx commands are generated when the map is
  136.                               evaluated.  The current index is not updated
  137.                               with the value of these ffffggggllllIIIInnnnddddeeeexxxx commands,
  138.  
  139.  
  140.  
  141.                                                                         PPPPaaaaggggeeee 2222
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148. ffffggggllllMMMMaaaapppp1111((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp1111((((3333GGGG))))
  149.  
  150.  
  151.  
  152.                               however.
  153.  
  154.      GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444          Each control point is four floating-point values
  155.                               representing red, green, blue, and alpha.
  156.                               Internal ffffggggllllCCCCoooolllloooorrrr4444 commands are generated when
  157.                               the map is evaluated.  The current color is not
  158.                               updated with the value of these ffffggggllllCCCCoooolllloooorrrr4444
  159.                               commands, however.
  160.  
  161.      GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL           Each control point is three floating-point
  162.                               values representing the x, y, and z components
  163.                               of a normal vector.  Internal ffffggggllllNNNNoooorrrrmmmmaaaallll commands
  164.                               are generated when the map is evaluated.  The
  165.                               current normal is not updated with the value of
  166.                               these ffffggggllllNNNNoooorrrrmmmmaaaallll commands, however.
  167.  
  168.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111  Each control point is a single floating-point
  169.                               value representing the s texture coordinate.
  170.                               Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd1111 commands are generated
  171.                               when the map is evaluated.  The current texture
  172.                               coordinates are not updated with the value of
  173.                               these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands, however.
  174.  
  175.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222  Each control point is two floating-point values
  176.                               representing the s and t texture coordinates.
  177.                               Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd2222 commands are generated
  178.                               when the map is evaluated.  The current texture
  179.                               coordinates are not updated with the value of
  180.                               these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands, however.
  181.  
  182.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333  Each control point is three floating-point
  183.                               values representing the s, t, and r texture
  184.                               coordinates.  Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd3333 commands are
  185.                               generated when the map is evaluated.  The
  186.                               current texture coordinates are not updated with
  187.                               the value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands,
  188.                               however.
  189.  
  190.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444  Each control point is four floating-point values
  191.                               representing the s, t, r, and q texture
  192.                               coordinates.  Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd4444 commands are
  193.                               generated when the map is evaluated.  The
  194.                               current texture coordinates are not updated with
  195.                               the value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands,
  196.                               however.
  197.  
  198.      _s_t_r_i_d_e, _o_r_d_e_r, and _p_o_i_n_t_s define the array addressing for accessing the
  199.      control points.  _p_o_i_n_t_s is the location of the first control point, which
  200.      occupies one, two, three, or four contiguous memory locations, depending
  201.      on which map is being defined.  _o_r_d_e_r is the number of control points in
  202.      the array.  _s_t_r_i_d_e tells how many float or double locations to advance
  203.      the internal memory pointer to reach the next control point.
  204.  
  205.  
  206.  
  207.                                                                         PPPPaaaaggggeeee 3333
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214. ffffggggllllMMMMaaaapppp1111((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp1111((((3333GGGG))))
  215.  
  216.  
  217.  
  218. NNNNOOOOTTTTEEEESSSS
  219.      As is the case with all GL commands that accept pointers to data, it is
  220.      as if the contents of _p_o_i_n_t_s were copied by ffffggggllllMMMMaaaapppp1111 before it returned.
  221.      Changes to the contents of _p_o_i_n_t_s have no effect after ffffggggllllMMMMaaaapppp1111 is called.
  222.  
  223. EEEERRRRRRRROOOORRRRSSSS
  224.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if _t_a_r_g_e_t is not an accepted value.
  225.  
  226.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _u_1 is equal to _u_2.
  227.  
  228.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _s_t_r_i_d_e is less than the number of values
  229.      in a control point.
  230.  
  231.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _o_r_d_e_r is less than one or greater than
  232.      GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR.
  233.  
  234.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ffffggggllllMMMMaaaapppp1111 is executed between the
  235.      execution of ffffggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ffffggggllllEEEEnnnndddd.
  236.  
  237. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  238.      ffffggggllllGGGGeeeettttMMMMaaaapppp
  239.      ffffggggllllGGGGeeeetttt with argument GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR
  240.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333
  241.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444
  242.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX
  243.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444
  244.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL
  245.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111
  246.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222
  247.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333
  248.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444
  249.  
  250.  
  251. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  252.      ffffggggllllBBBBeeeeggggiiiinnnn, ffffggggllllCCCCoooolllloooorrrr, ffffggggllllEEEEnnnnaaaabbbblllleeee, ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd, ffffggggllllEEEEvvvvaaaallllMMMMeeeesssshhhh, ffffggggllllEEEEvvvvaaaallllPPPPooooiiiinnnntttt,
  253.      ffffggggllllMMMMaaaapppp2222, ffffggggllllMMMMaaaappppGGGGrrrriiiidddd, ffffggggllllNNNNoooorrrrmmmmaaaallll, ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, ffffggggllllVVVVeeeerrrrtttteeeexxxx
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.                                                                         PPPPaaaaggggeeee 4444
  274.  
  275.  
  276.  
  277.